/*
 * @FilePath: /wkw/vite.test.config.ts
 * 介绍:测试环境配置项
 */

import { defineConfig, loadEnv, ConfigEnv } from "vite";
import path from "path";
export default (config: ConfigEnv) => {
  const env = loadEnv(config.mode, process.cwd(), "VITE_");
  return defineConfig({
    build: {
      outDir: path.join(__dirname, "dist/test"),
      rollupOptions: {
        output: {
          chunkFileNames: "static/js/[name]-[hash].js",
          entryFileNames: "static/js/[name]-[hash].js",
          assetFileNames: "static/[ext]/[name]-[hash].[ext]",
        },
        manualChunks(id) {
          if (id.includes("node_modules")) {
            return "vendor";
          }
        },
      },
    },
  });
};
